//
// Created by Dinger on 2021/9/18.
//

#ifndef FUNDAMENTALS_OF_COMPILING_LEXICAL_FORM_H
#define FUNDAMENTALS_OF_COMPILING_LEXICAL_FORM_H
#include"stdafx.h"
#include"word.h"
using namespace std;
/**
 * 词法表类
 */
class LexicalForm {
private:
    //表
    vector<Word> _lexicalForm;
    //关键字表
    map<string, int> _keyWordForm;
    //系统单词表
    map<string, int> _systemWordForm;

    int _keyWordPosition_up;
    int _keyWordPosition_down;

    /**
     * 读取文件
     * @param fileName 文件名
     */
    void readFile(string fileName);

    /**
     * 找关键字
     */
    void findKeyWord();

public:
    LexicalForm();

    LexicalForm(string fileName);

    map<string, int> getKeyWordForm() {
        return _keyWordForm;
    }

    map<string, int> getSystemWordForm() {
        return _systemWordForm;
    }
};
#endif //FUNDAMENTALS_OF_COMPILING_LEXICAL_FORM_H
